import request  from "@/utils/request";


// 登录
export const login = (loginname:string,password:string)=>{
  return request({
    url:'/user/login',
    method:"post",
    data:{
      loginname,password
    }
  })
}

// 检查手机号码是否被注册
export const checkPhone = (tel:string)=>{
  return request({
    url:'/user/docheckphone',
    method:'post',
    data:{
      tel
    }
  })
}

// 发送验证码
export const sendTelCode = (tel:string)=>{
  return request({
    url:'/user/dosendmsgcode',
    method:"post",
    data:{
      tel
    }
  })
}

// 验证码是否正确
export const checkCode = (tel:string,telcode:string)=>{
  return request({
    url:'/user/docheckcode',
    method:'post',
    data:{
      tel,telcode
    }
  })
}

// 电话注册接口
export const register = (tel:string,password:string)=>{
  return request({
    url:'/user/dofinishregister',
    method:'post',
    data:{
      tel,password
    }
  })
}